﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LazyKex
{

    public class LazyKDislexicException : Exception
    {
        public LazyKDislexicException(string message) : base(message)
        {
        }

    }

    public class LazyKDislexic
    {

        private char[] tokens;
        private int currentToken = -1;
        private int end;

        public LazyKDislexic(string fileContent)
        {
            this.tokens = fileContent.Replace(Environment.NewLine, null).Replace(" ",null).ToCharArray();
            this.end = tokens.Length;
        }

        public bool HasMoreTokens()
        {
            return currentToken + 1 < end;

        }

        public char NextToken()
        {
            currentToken++;
            
            switch (tokens[currentToken])
            {
                case 'S':
                case 's':
                case 'K':
                case 'k':
                case 'I':
                case 'i':
                case '*':
                case '`':
                case '0':
                case '1':
                case '(':
                case ')':
                    return tokens[currentToken];
                default:
                    throw new LazyKDislexicException("Caracter invalido detectado! " + tokens[currentToken]);
            }

         }

        public char CurrentToken()
        {
            return tokens[currentToken];
        }


    }
}
